import Vue from 'vue'
import VueRouter from 'vue-router'
import App from '../App.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import HomePage from '../views/HomePage.vue'
import EpBsInfo from '../views/EpBsInfo.vue'
import BasicInfo from '../views/EpInfoMn/BasicInfo.vue'
import MyPolicy from '../views/EpInfoMn/MyPolicy.vue'
import ResetPwd from '../views/EpInfoMn/ResetPwd.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'app',
    component: App,
    redirect: '/homepage',
  },
  {
    path: '/homepage',
    name: 'homepage',
    component: HomePage,
    children: [
      {
        path: '/login',
        name: 'login',
        component: Login,
      },
      {
        path: '/register',
        name: 'register',
        component: Register,
      },
      {
        path: '/epbsinfo',
        name: 'epbsinfo',
        component: EpBsInfo,
        children:[
          {
            path: '/basicinfo',
            name: 'basicinfo',
            component: BasicInfo,
          },
          {
            path: '/mypolicy',
            name: 'mypolicy',
            component: MyPolicy,
          },
          {
            path: '/resetpwd',
            name: 'resetpwd',
            component: ResetPwd,
          },
        ]
      }
    ]
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
